//登录接口相关的函数
import request from "../../utils/request"


//切换公司id
export const companies = (params) => {
  return request.get("/api/users/companies", { params })
}
export const companyId = (data) => {
  return request.post("/api/users/set_company_id", data)
}
//获取下载记录
export const downloadJob = (params) => {
  return request.get("api/download_job/index", { params })
}
//获取消息
export const MessageIndex = (params) => {
  return request.get("/api/message/index", { params })
}
//消息标记为已读
export const Readall = (data) => {
  return request.post("/api/message/set_had_read", data)
}
//未读消息数
export const readCount = (params) => {
  return request.get("/api/message/no_read_count", params)
}
//重新下载
export const reDownload = (data) => {
  return request.post("api/download_job/re_download", data)
}


//获取当前选中公司的id
/* 
export const Import = (params) => {
  return request.get("/api/companies/company_id", { params })
} */

const api = {
  register(query) { //个人注册
    return request({
      url: '/api/register',
      method: 'POST',
      data: JSON.stringify(query)
    })
  },
  login(query) {//登录
    return request({
      url: '/api/login',
      method: 'POST',
      data: JSON.stringify(query),

    })
  },
  logout(query) {//退出
    return request({
      url: '/api/logout',
      method: 'POST',
      data: JSON.stringify(query)
    })
  },
  companyId(query) {
    return request({
      url: '/api/users/set_company_id',
      method: 'POST',
      data: JSON.stringify(query)
    })
  },



}



export default api;